package com.laf.mall.api.service.impl;

import com.laf.mall.api.dto.PointsDeduction;
import com.laf.mall.api.repository.PointsDeductionRepository;
import com.laf.mall.api.service.PointsDeductionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ygl
 * @create 2019-01-02
 * @DESCRIPTION
 **/
@Service
public class PointsDeductionServiceImpl implements PointsDeductionService {

    @Autowired
    private PointsDeductionRepository repository;

    @Override
    public int insert(PointsDeduction model) {
        return repository.insert(model);
    }

    @Override
    public List<PointsDeduction> findByOffsetNumber(String offsetNumber) {
        return repository.findByOffsetNumber(offsetNumber);
    }

    @Override
    public int updateStatus(PointsDeduction deduction) {
        return repository.updateStatus(deduction.getId(),deduction.getStatus(),deduction.getBizDate());
    }

    @Override
    public List<PointsDeduction> findByMemberId(Integer memberId) {
        return repository.findByMemberId(memberId);
    }
}
